<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Jetson Inference: v4l2Camera Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="NVLogo_2D.jpg"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Jetson Inference
   </div>
   <div id="projectbrief">DNN Vision Library</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('classv4l2Camera.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="classv4l2Camera-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">v4l2Camera Class Reference<div class="ingroups"><a class="el" href="group__util.html">Utilities Library (jetson-utils)</a> &raquo; <a class="el" href="group__camera.html">Camera Capture</a></div></div>  </div>
</div><!--header-->
<div class="contents">

<p>Video4Linux2 (V4L2) camera capture streaming.  
 <a href="classv4l2Camera.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="v4l2Camera_8h_source.html">v4l2Camera.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:adc4c7175473362fbd763fc6bcd4589df"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classv4l2Camera.html#adc4c7175473362fbd763fc6bcd4589df">~v4l2Camera</a> ()</td></tr>
<tr class="memdesc:adc4c7175473362fbd763fc6bcd4589df"><td class="mdescLeft">&#160;</td><td class="mdescRight">Destructor.  <a href="#adc4c7175473362fbd763fc6bcd4589df">More...</a><br /></td></tr>
<tr class="separator:adc4c7175473362fbd763fc6bcd4589df"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a206ecceaf8cbcc6c4bf7b7c93f16d069"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classv4l2Camera.html#a206ecceaf8cbcc6c4bf7b7c93f16d069">Open</a> ()</td></tr>
<tr class="memdesc:a206ecceaf8cbcc6c4bf7b7c93f16d069"><td class="mdescLeft">&#160;</td><td class="mdescRight">Start streaming.  <a href="#a206ecceaf8cbcc6c4bf7b7c93f16d069">More...</a><br /></td></tr>
<tr class="separator:a206ecceaf8cbcc6c4bf7b7c93f16d069"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aca49ec2b7d7d60af6422da91b5bc0272"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classv4l2Camera.html#aca49ec2b7d7d60af6422da91b5bc0272">Close</a> ()</td></tr>
<tr class="memdesc:aca49ec2b7d7d60af6422da91b5bc0272"><td class="mdescLeft">&#160;</td><td class="mdescRight">Stop streaming.  <a href="#aca49ec2b7d7d60af6422da91b5bc0272">More...</a><br /></td></tr>
<tr class="separator:aca49ec2b7d7d60af6422da91b5bc0272"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:addd045d6f50e92cc4b0c96f156eebcd6"><td class="memItemLeft" align="right" valign="top">void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classv4l2Camera.html#addd045d6f50e92cc4b0c96f156eebcd6">Capture</a> (size_t timeout=0)</td></tr>
<tr class="memdesc:addd045d6f50e92cc4b0c96f156eebcd6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the next image.  <a href="#addd045d6f50e92cc4b0c96f156eebcd6">More...</a><br /></td></tr>
<tr class="separator:addd045d6f50e92cc4b0c96f156eebcd6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa3ce83a56b2e54115b18a502f384d6de"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classv4l2Camera.html#aa3ce83a56b2e54115b18a502f384d6de">GetWidth</a> () const</td></tr>
<tr class="memdesc:aa3ce83a56b2e54115b18a502f384d6de"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get width, in pixels, of camera image.  <a href="#aa3ce83a56b2e54115b18a502f384d6de">More...</a><br /></td></tr>
<tr class="separator:aa3ce83a56b2e54115b18a502f384d6de"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9c972f38c4217cff7830ac798b58b2b4"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classv4l2Camera.html#a9c972f38c4217cff7830ac798b58b2b4">GetHeight</a> () const</td></tr>
<tr class="memdesc:a9c972f38c4217cff7830ac798b58b2b4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Retrieve height, in pixels, of camera image.  <a href="#a9c972f38c4217cff7830ac798b58b2b4">More...</a><br /></td></tr>
<tr class="separator:a9c972f38c4217cff7830ac798b58b2b4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a615fb394627a68c35fee8dcf84897eef"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classv4l2Camera.html#a615fb394627a68c35fee8dcf84897eef">GetPitch</a> () const</td></tr>
<tr class="memdesc:a615fb394627a68c35fee8dcf84897eef"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the size in bytes of one line of the image.  <a href="#a615fb394627a68c35fee8dcf84897eef">More...</a><br /></td></tr>
<tr class="separator:a615fb394627a68c35fee8dcf84897eef"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a844f31302f43806e6e19c15d31bdacc8"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classv4l2Camera.html#a844f31302f43806e6e19c15d31bdacc8">GetPixelDepth</a> () const</td></tr>
<tr class="memdesc:a844f31302f43806e6e19c15d31bdacc8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the bit depth per pixel.  <a href="#a844f31302f43806e6e19c15d31bdacc8">More...</a><br /></td></tr>
<tr class="separator:a844f31302f43806e6e19c15d31bdacc8"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:aeed02b9889fd51c79f18aabb05c9c5a3"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classv4l2Camera.html">v4l2Camera</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classv4l2Camera.html#aeed02b9889fd51c79f18aabb05c9c5a3">Create</a> (const char *device_path)</td></tr>
<tr class="memdesc:aeed02b9889fd51c79f18aabb05c9c5a3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create V4L2 interface.  <a href="#aeed02b9889fd51c79f18aabb05c9c5a3">More...</a><br /></td></tr>
<tr class="separator:aeed02b9889fd51c79f18aabb05c9c5a3"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Video4Linux2 (V4L2) camera capture streaming. </p>
<dl class="section note"><dt>Note</dt><dd><a class="el" href="classgstCamera.html" title="MIPI CSI and V4L2 camera capture using GStreamer and nvarguscamerasrc or v4l2src elements. ">gstCamera</a>, which convieniently handles both V4L2 and MIPI CSI cameras, is used mostly in lieu of <a class="el" href="classv4l2Camera.html" title="Video4Linux2 (V4L2) camera capture streaming. ">v4l2Camera</a>. <a class="el" href="classv4l2Camera.html" title="Video4Linux2 (V4L2) camera capture streaming. ">v4l2Camera</a> is provided in the event that you would rather interface with V4L2 directly, rather than go through GStreamer. </dd></dl>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="adc4c7175473362fbd763fc6bcd4589df"></a>
<h2 class="memtitle"><span class="permalink"><a href="#adc4c7175473362fbd763fc6bcd4589df">&#9670;&nbsp;</a></span>~v4l2Camera()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">v4l2Camera::~v4l2Camera </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Destructor. </p>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="addd045d6f50e92cc4b0c96f156eebcd6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#addd045d6f50e92cc4b0c96f156eebcd6">&#9670;&nbsp;</a></span>Capture()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void* v4l2Camera::Capture </td>
          <td>(</td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>timeout</em> = <code>0</code></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Return the next image. </p>

</div>
</div>
<a id="aca49ec2b7d7d60af6422da91b5bc0272"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aca49ec2b7d7d60af6422da91b5bc0272">&#9670;&nbsp;</a></span>Close()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool v4l2Camera::Close </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Stop streaming. </p>

</div>
</div>
<a id="aeed02b9889fd51c79f18aabb05c9c5a3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aeed02b9889fd51c79f18aabb05c9c5a3">&#9670;&nbsp;</a></span>Create()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="classv4l2Camera.html">v4l2Camera</a>* v4l2Camera::Create </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>device_path</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Create V4L2 interface. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">path</td><td>Filename of the video device (e.g. /dev/video0) </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a9c972f38c4217cff7830ac798b58b2b4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9c972f38c4217cff7830ac798b58b2b4">&#9670;&nbsp;</a></span>GetHeight()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t v4l2Camera::GetHeight </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Retrieve height, in pixels, of camera image. </p>

</div>
</div>
<a id="a615fb394627a68c35fee8dcf84897eef"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a615fb394627a68c35fee8dcf84897eef">&#9670;&nbsp;</a></span>GetPitch()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t v4l2Camera::GetPitch </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Return the size in bytes of one line of the image. </p>

</div>
</div>
<a id="a844f31302f43806e6e19c15d31bdacc8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a844f31302f43806e6e19c15d31bdacc8">&#9670;&nbsp;</a></span>GetPixelDepth()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t v4l2Camera::GetPixelDepth </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Return the bit depth per pixel. </p>

</div>
</div>
<a id="aa3ce83a56b2e54115b18a502f384d6de"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa3ce83a56b2e54115b18a502f384d6de">&#9670;&nbsp;</a></span>GetWidth()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t v4l2Camera::GetWidth </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Get width, in pixels, of camera image. </p>

</div>
</div>
<a id="a206ecceaf8cbcc6c4bf7b7c93f16d069"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a206ecceaf8cbcc6c4bf7b7c93f16d069">&#9670;&nbsp;</a></span>Open()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool v4l2Camera::Open </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Start streaming. </p>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>jetson-utils/<a class="el" href="v4l2Camera_8h_source.html">v4l2Camera.h</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="classv4l2Camera.html">v4l2Camera</a></li>
    <li class="footer">Generated on Thu Sep 26 2019 12:19:12 for Jetson Inference by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li>
  </ul>
</div>
</body>
</html>
